<template>
    <div class="attendanceStatisticsContent">
        <img src="@/assets/bigScreen/icons/left/moduls_bg.png" alt="">
        <div class="titles_moduls">
            <img src="@/assets/bigScreen/icons/right/cqtj.png" alt="">
            出勤统计
        </div>
        <div class="contents">
            <div class="top_count">
                <div class="all_toatl">
                    <img src="@/assets/bigScreen/icons/right/cqtj_rs.png" alt="">
                    <div class="infs">
                        <div class="title">
                            总人数
                        </div>
                        <div class="count">
                            <count-to :startVal="0" :endVal="totalPeopleNumber" :duration="4000" suffix=""></count-to>
                            <span class="dw">人</span>
                        </div>
                    </div>
                </div>
                <div class="day_count">
                    <img src="@/assets/bigScreen/icons/right/cqtj_rs.png" alt="">
                    <div class="infs">
                        <div class="title">
                            当日出勤人数
                        </div>
                        <div class="count">
                            <count-to :startVal="0" :endVal="attendancePeopleNumber" :duration="4000"
                                suffix=""></count-to>

                            <span class="dw">人</span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="shift_list">
                <div class="list_header_title">
                    <div class="list_header_type">
                        值班类型
                    </div>
                    <div class="list_header_time">
                        值班时间
                    </div>
                    <div class="list_header_leader">
                        带班领导
                    </div>
                    <div class="list_header_phone">
                        联系方式
                    </div>
                </div>
                <div class="bottom_infs_content" v-for="(item, index) in data" :key="index">
                    <div class="list_header_type">
                        <div :class="`list_header_type_${item.schedulingName}`">
                            {{ item.schedulingName == 1 ? "早班" : item.schedulingName == 2 ? "中班" : "晚班" }}
                        </div>
                    </div>
                    <div class="list_header_time">
                        {{ item.schedulingBeginTime }}~{{ item.schedulingEndTime }}
                    </div>
                    <div class="list_header_leader">
                        {{ item.groupLeaderName }}
                    </div>
                    <div class="list_header_phone">
                        {{ item.groupLeaderTel }}
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import { getAttendanceStatistics } from "@/api/bigScreen/home.js";
import CountTo from 'vue-count-to'

export default {
    components: {
        CountTo
    },
    data() {
        return {
            totalPeopleNumber: 0,
            attendancePeopleNumber: 0,
            data: [
                {
                    groupLeaderName: "向家珍",
                    groupLeaderTel: "18651355291",
                    schedulingBeginTime: "07:30",
                    schedulingEndTime: "15:30",
                    schedulingName: 1
                }, {
                    groupLeaderName: "陈维波",
                    groupLeaderTel: "18994931773",
                    schedulingBeginTime: "15:30",
                    schedulingEndTime: "23:30",
                    schedulingName: 2
                }, {
                    groupLeaderName: "陈维强",
                    groupLeaderTel: "18994931773",
                    schedulingBeginTime: "23:30",
                    schedulingEndTime: "07:30",
                    schedulingName: 3
                }
            ]
        };
    },
    mounted() {
        this.getAll()
    },
    methods: {
        getAll() {
            getAttendanceStatistics().then(res => {
                if (res.code == 200) {
                    this.data = res.data.schedulingGroupList
                    this.totalPeopleNumber = res.data.totalPeopleNumber
                    this.attendancePeopleNumber = res.data.attendancePeopleNumber
                }
            })
        }
    },
};
</script>

<style scoped lang="scss">
@font-face {
    font-family: 'kk';
    src: url('../../../../../assets/font/kuaikanshijieti-Regular.ttf');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'al';
    src: url('../../../../../assets/font/Alibaba-PuHuiTi-Bold_0.ttf');
    font-weight: normal;
    font-style: normal;
}

.attendanceStatisticsContent {
    width: 100%;
    position: relative;

    img {
        width: 100%;
    }


    .titles_moduls {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        position: absolute;
        top: 3%;
        left: 1.5%;

        img {
            width: 1.2vw;
            margin-right: 0.5208vw;
        }


        font-size: 0.8333vw;
        font-weight: 400;
        letter-spacing: 0.0208vw;
        font-family: kk;
        color: transparent;
        background-image: linear-gradient(180deg, rgba(153, 253, 255, 1) 0%, rgba(13, 110, 255, 1) 100%);
        -webkit-background-clip: text;
        background-clip: text;

    }

    .contents {
        position: absolute;
        top: 16%;


        .top_count {
            width: 100%;

            display: flex;
            align-items: center;
            justify-content: space-evenly;

            .all_toatl,
            .day_count {
                width: 40%;
                position: relative;

                img {
                    width: 100%;
                }

                .infs {
                    width: 50%;
                    display: flex;
                    flex-direction: column;
                    position: absolute;
                    right: 10%;
                    top: 10%;

                    .title {
                        font-size: .625vw;
                        font-weight: 400;
                        color: rgba(255, 255, 255, 1);
                        margin-bottom: 5px;
                    }

                    .count {
                        font-size: 1.25vw;
                        font-weight: 400;
                        font-family: kk;
                        color: transparent;
                        background-image: linear-gradient(180deg, rgba(153, 253, 255, 1) 0%, rgba(13, 110, 255, 1) 100%);
                        -webkit-background-clip: text;
                        background-clip: text;

                        .dw {
                            font-size: .625vw;
                            font-weight: 400;
                            font-family: kk;
                            color: transparent;
                            background-image: linear-gradient(180deg, rgba(153, 253, 255, 1) 0%, rgba(13, 110, 255, 1) 100%);
                            -webkit-background-clip: text;
                            background-clip: text;
                        }
                    }
                }
            }

            .day_count {
                width: 40%;

                img {
                    width: 100%;
                }
            }
        }

        .shift_list {
            width: 97%;
            padding: 0 1.5%;
            margin: 0 auto;
            margin-top: 2%;
            // height: 155px;
            // background-color: #fff;

            .list_header_title {
                width: 100%;
                padding: 6px 0;
                background: rgba(0, 155, 254, 0.2);
                font-size: 0.7292vw;
                font-weight: 500;
                color: rgba(255, 255, 255, 1);
                text-align: center;
                display: flex;
                align-items: center;
            }

            .list_header_title>div {
                width: 25%;
            }

            .bottom_infs_content {
                width: 100%;
                display: flex;
                align-items: center;
                padding: 6px 0;
                background: rgba(0, 155, 254, 0.2);
                margin-top: 8px;
                cursor: pointer;
                border-top: 1px solid;
                border-bottom: 1px solid;
                border-image: linear-gradient(to right, rgba(0, 255, 240, 0), rgba(0, 201, 248, 1), rgba(0, 255, 240, 0)) 1;
                transition: all 0.3s ease;
                &:hover {
                    border: 1px solid;
                    border-image: linear-gradient(to bottom, rgba(0, 155, 254, 1), rgba(0, 255, 240, 1)) 1;
                }

                &>div {
                    width: 25%;
                }

                .list_header_type {
                    width: 25%;
                    display: flex;
                    align-items: center;
                    justify-content: center;

                    &_1,
                    &_2,
                    &_3 {
                        width: 50%;
                        text-align: center;
                        font-size: 0.7292vw;
                        font-weight: 500;
                        color: rgba(6, 49, 89, 1);
                        border-radius: 6px;
                    }

                    &_1 {
                        background: linear-gradient(180deg, rgba(84, 240, 188, 1) 0%, rgba(42, 222, 94, 1) 100%);
                    }

                    &_2 {
                        background: linear-gradient(180deg, rgba(255, 235, 59, 1) 0%, rgba(255, 176, 58, 1) 100%);
                    }

                    &_3 {
                        background: linear-gradient(180deg, rgba(153, 253, 255, 1) 0%, rgba(13, 110, 255, 1) 100%);
                    }
                }

                .list_header_time,
                .list_header_leader,
                .list_header_phone {
                    width: 25%;
                    font-size: 0.7292vw;
                    font-weight: 500;
                    color: rgba(255, 255, 255, 1);
                    text-align: center;


                }
            }


        }
    }
}
</style>